package com.czxy.enterprise.controller;


import com.czxy.domain.TbOccupation;
import com.czxy.enterprise.service.OccupationService;
import com.czxy.findjob.vo.BaseResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 职业种类表 前端控制器
 * </p>
 *
 * @author xuewen
 * @since 2022-01-25
 */
@RestController
@RequestMapping("/occupation")
public class OccupationController {
    @Autowired
    private OccupationService occupationService;
    @GetMapping
    public BaseResult findAll(){
        return BaseResult.ok("查询成功",occupationService.list());
    }
    @GetMapping("/{id}")
    public BaseResult<TbOccupation> findById(@PathVariable("id") Integer id){
        TbOccupation tbOccupation = occupationService.getById(id);
        return BaseResult.ok("查询成功",tbOccupation);
    }
}

